{template 'common/header'}
{template 'common'}
<ul class="nav nav-tabs">
    <li {if $operation == 'post'}class="active"{/if}>
    <a href="{php echo $this->createWebUrl('vrview', array('op' => 'post'))}">发布全景图</a></li>	
    <li {if $operation == 'display'}class="active"{/if}>
    <a href="{php echo $this->createWebUrl('vrview', array('op' => 'display'))}">管理</a></li>
   
</ul>
<script>
    require(['bootstrap'],function($){	
        $('.btn').hover(function(){	
            $(this).tooltip('show');	
        },function(){	
            $(this).tooltip('hide');	
        });	
    });
</script>

{if $operation == 'post'}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
        <div class="panel panel-default">
            <div class="panel-heading">  添加全景图	 </div>	
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">标题信息：</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="data[title]" class="form-control" value="{$info['title']}" />
                    </div>
                </div>
             		
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"> 介绍信息</label>
                    <div class="col-sm-9 col-xs-12">
                        <textarea type="text" name="data[smalltext]"
                          id="newstext" class="form-control"
                          placeholder="  ">{$info['smalltext']}</textarea>
                       
                    </div>	
                </div>	
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">空间位置：</label>
                     
                    <div class="col-sm-9 col-xs-12">
                    <input type="text" name="data[fname]" class="form-control" value="{$info['fname']}" /> 
                    </div>
                </div>
                <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">全局图片</label>

                    <div class="col-sm-9 col-xs-12">

                            {php echo tpl_form_field_multi_image('thumb', $info['newstext'])}

                    </div>

            </div>
                
               <div class="form-group">
                   <label class="col-xs-12 col-sm-3 col-md-2 control-label"> &nbsp;</label> 
                   <div class="col-sm-9 col-xs-12">
                       <p>Tips：记得继续上传全景图片。</p>
                   </div>
               </div>
                
            </div>	
        </div>	
        <div class="form-group col-sm-12">
            <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />	
            <input type="hidden" name="token" value="{$_W['token']}" />	
        </div>
    </form>
</div>
 

{elseif $operation == 'display'}
<div class="main">
    <div class="category">
        <form action="" method="post" onsubmit="return formcheck(this)">
            <div class="panel panel-default">	
                <div class="panel-body table-responsive">
                    <table class="table table-hover">
                        <thead class="navbar-inner">
                            <tr>
                                 <th style="width:5%;"></th> 	
                                <th style="width: 10%;">顺序</th>
                                <th style="width:65%;"> 标题</th>
                                
                                <th style="width:20%;">操作</th>
                            </tr>	
                        </thead>
                        <tbody>	
                            {if $list}	
                            {loop $list $row}
                            <tr>
                                <td>{$row['id']}</td> 
                                <td><input type="text" size="2" class="form-control"  name="displayorder[{$row['id']}]" value="{$row['orderid']}"></td>
                                <td>
                                    {if $row['thumb']}
                                    <img src="{php echo tomedia($row['thumb']);}" width='120' height="80" onerror="$(this).remove()"  
                                         style='padding:1px;border: 1px solid #ccc;float:left;margin-right:5px;' />
                                    {/if}
                                    <div class="type-parent" style="padding-left:10px;">
                                        <p>{$row['title']} </p>
                                        <p><a href="{$_W['siteroot']}app/{php echo  $this->createMobileUrl('vrview', array('op' => 'show', 'id' => $row['id']))}" target="_blank">
                                              {$_W['siteroot']}app/{php echo  $this->createMobileUrl('vrview', array('op' => 'show', 'id' => $row['id']))}</a> </p>
                                        <p style="color:#999">发布：{$row['addtime']} </p> 
                                    </div>
                                </td>
                             
                                <td>
                                   
                                    <a href="{php echo $this->createWebUrl('vrview', array('op' => 'post', 'id' => $row['id']))}"
                                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="编辑">
                                        <i class="fa fa-edit"></i></a>&nbsp;&nbsp;
                                        <a href="{php echo $this->createWebUrl('vrview', array('op' => 'delete', 'id' => $row['id']))}"
                                           onclick="return confirm('确认删除此分类吗？');return false;" class="btn btn-default btn-sm"
                                           data-toggle="tooltip" data-placement="bottom" title="删除"><i class="fa fa-times"></i></a>
                                </td>
                            </tr>	
                            {/loop}
                            {else}
                            <tr>
                                <td colspan="5">
                                    <a href="{php echo $this->createWebUrl('vrview', array('op' => 'post'))}">
                                        <i class="fa fa-plus-sign-alt"></i> 发布全景图看房</a>
                                </td>			
                            </tr>	
                            {/if}	
                            <tr>
                                <td colspan="5">
                                    <input name="submit" type="submit" class="btn btn-primary" value="提交">
                                    <input type="hidden" name="token" value="{$_W['token']}" />	
                                </td>		
                            </tr>	
                        </tbody>	
                    </table>	
                </div>		
            </div>	
        </form>	
    </div>
    {$pager}
</div>
{/if}
        
{template 'common/footer'} 
        